package com.tuanzi.loan.web.lazy.credithousekeeper;

import com.tuanzi.loan.business.service.credithousekeeper.CreditCompensatoryChildOrderStatService;
import com.tuanzi.loan.core.lazy.BaseLazyDataModel;
import com.tuanzi.loan.core.util.SpringContextHolder;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.credithousekeeper.CreditCompensatoryChildOrderStatRequest;
import com.tuanzi.loan.vo.response.credithousekeeper.CreditCompensatoryChildOrderStatResponse;
import org.springframework.data.domain.Page;

import java.io.Serializable;

public class CreditCompensatoryChildOrderStatLazyDataModel extends BaseLazyDataModel<CreditCompensatoryChildOrderStatRequest,CreditCompensatoryChildOrderStatResponse> implements Serializable {

    private CreditCompensatoryChildOrderStatService creditCompensatoryChildOrderStatService = SpringContextHolder.getBean(CreditCompensatoryChildOrderStatService.class);

    public CreditCompensatoryChildOrderStatLazyDataModel(CreditCompensatoryChildOrderStatRequest creditCompensatoryChildOrderStatRequest) {
        super(creditCompensatoryChildOrderStatRequest);
    }

    @Override
    protected Page<CreditCompensatoryChildOrderStatResponse> doLoad(PageSearcher<CreditCompensatoryChildOrderStatRequest> pageSearcher) {

        return creditCompensatoryChildOrderStatService.list(pageSearcher);
    }
}
